﻿using System;
using System.Collections.Generic;
using System.Text;

namespace oceanho.webapi.factory.httpUtility
{
    /// <summary>
    /// 定义一个对字符串进行编码管理的工具类
    /// </summary>
    internal sealed class EncodingUtility
    {
        /// <summary>
        /// 通过执行的Encoding获取字符串的bytes数组
        /// </summary>
        /// <param name="str">字符串</param>
        /// <param name="encoding">编码</param>
        /// <returns></returns>
        public static byte[] get_bytes(string str, Encoding encoding)
        {
            return encoding.GetBytes(str);
        }
    }
}
